package com.nycreativity.elecreativity.entity.enums

enum class OrderStatusEnum(
    /**
     * 订单状态说明
     */
    val des: String,

    /**
     * 订单状态code
     */
    val status: Int
) {

    /**
     * 待付款
     */
    WAITING_FOR_PAYMENT("待付款", 0),

    /**
     * 待发货
     */
    WAITING_FOR_DELIVER("待发货", 1),

    /**
     * 待签收
     */
    WAITING_FOR_SIGN("待签收", 2),

    /**
     * 已签收
     */
    HAS_SIGNED("已签收", 3),

    /**
     * 已冻结,换货中
     */
    EXCHANGING("已冻结,换货中", 4),

    /**
     * 已换货
     */
    HAS_EXCHANGED("已换货", 5),

    /**
     * 已冻结,退货中
     */
    GOODS_RETURNING("已冻结,退货中", 6),

    /**
     * 已退货
     */
    HAS_RETURNED("已退货", 7),

    /**
     * 已退款
     */
    HAS_REFUNDED("已退款", 8);

    companion object {
        @JvmStatic
        fun getStatusDes(status: Int): OrderStatusEnum? {
            return OrderStatusEnum.values().filter { it.status == status }.firstOrNull()
        }
    }

}